import { ajax } from "@/utils/ajax.js"

export const stateEnum = {
	all:-1,
	pending:0, 
	pass:1, 
	reject:2 
}

export const fetchApplies = ({groupId,status,pageNo=1,pageSize=10})=>{
	return ajax({
		url:'/userGroupApply/joinUserApplyList',
		data:{
			groupId,
			status,
			pageNo,
			pageSize
		}
	})
}

export const agreeApply = ({id}) =>{
	return ajax({
		url:'/userGroupApply/allowUserJoin',
		data:{
			id
		}
	})
}

export const rejectApply = ({id,reason})=>{
	return ajax({
		url:'/userGroupApply/rejectUserJoin',
		data:{
			id,
			reason
		}
	})
}